package com.dlc.yunguang.adapter;

import android.graphics.Color;
import android.widget.TextView;

import com.dlc.commonlibrary.adapter.BaseRecyclerAdapter;
import com.dlc.yunguang.net.bean.RFIDListBean;
import com.dlc.yunguang.R;

/**
 * Created by John on 2017/7/24.
 */

public class BucaoResultAdapter extends BaseRecyclerAdapter<RFIDListBean.DataBean.ListBean> {
    @Override
    public int getItemLayoutId(int viewType) {
        return R.layout.item_bucao_result;
    }

    @Override
    public void onBindViewHolder(CommonHolder holder, int position) {
        RFIDListBean.DataBean.ListBean item = getItem(position);
       // holder.setText(R.id.tv_rfid, item.cardno);
        holder.setText(R.id.tv_name, item.title);
        holder.setText(R.id.tv_spec, item.spec);
        TextView tv_rfid = holder.getView(R.id.tv_rfid);
        if (item.state == 0){
            tv_rfid.setTextColor(Color.parseColor("#333333"));
        }else {
            tv_rfid.setTextColor(Color.parseColor("#FF6666"));
        }
        tv_rfid.setText( item.cardno);
    }
}
